package cn.maxhou.mapper;

import cn.maxhou.entity.Supplier;
import cn.maxhou.service.Supplierervice;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import static org.junit.jupiter.api.Assertions.*;

class SupplierMapperTest5 {

    @Test
    void deleteById() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext5.xml");
        Supplierervice supplierservice = (Supplierervice) context.getBean("supplierervice2");
        int i = supplierservice.deleteById(116);
        if (i==1){
            System.out.println("删除成功");
        }
    }

    @Test
    void update() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext5.xml");
        Supplierervice supplierservice = (Supplierervice) context.getBean("supplierervice2");

        Supplier supplier = new Supplier(117,"S17","郴州天河软件开发责任有限公司888","侯慧聪开的公司888","侯慧聪","17773572868","北湖区天星公园1号");
        int update = supplierservice.update(supplier);
        if (update==1){
            System.out.println("修改成功");
        }
    }
}